package com.xbn.common.valid.annotation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @author XBN
 * @date 2020/7/9 12:59
 * @email 78742541@qq.com
 */
/*
* 自定义校验注解
* */
//声明注解标识的位置
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE,
        ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
//校验注解的运行时机
@Retention(RetentionPolicy.RUNTIME)
@Documented
//指定校验逻辑，用什么来校验
@Constraint(
        validatedBy = {ListValuesConstraintValidator
        .class}
)
public @interface ListValues {
    //提示信息
    String message() default "{com.xbn.common.valid.ListValues.message}";
  //组
    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
    //放值
    int[] vals() default {};
}
